<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>函数计算圆的面积和周长</title>
</head>
<body>
  <script>
 
    function getArea(r) {
      r = r || 0;
      var pai = 3.1415926;
      return pai * r * r;
   }
    var area = getArea(5);
    console.log(area);
    function getLong (r) {
         r = r || 0;
         return 2 * Math.PI * r;
     }
     var long = getLong(5);
     console.log("半径为5的圆的周长是："+long);
  </script>
</body>
</html>
